package top.xiangqifu.springboot2.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import top.xiangqifu.springboot2.user.validate.ApiValidate;
import top.xiangqifu.springboot2.user.validate.RegInfo;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
/**
 * 托管的api地址信息表
 *
 * @author 向启福
 */
@TableName("tb_actions")
@ApiModel(value = "托管的api地址信息" , description = "托管的api地址信息应答对象")
@Data
public class TbActions implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键",example = "1")
    @ApiParam(hidden = false)
    private Integer aid;
    @NotBlank(message = "api的url地址必须填写",groups = {ApiValidate.Add.class})
    @Pattern(regexp = RegInfo.API_URL,message = "格式必须是/。。/。。/。。",groups = {ApiValidate.Add.class})
    @ApiModelProperty(value = "api的url地址",example = "/userinfo")
    @ApiParam(hidden = false)
    private String url;
    @NotBlank(message = "api的请求方法",groups = {ApiValidate.Add.class})
    @Pattern(regexp = RegInfo.API_REQUEST,message = "只能为get,post,put,delete,patch",groups = {ApiValidate.Add.class})
    @ApiModelProperty(value = "api的请求方法",example = "get")
    @ApiParam(hidden = false)
    private String method;
    @ApiModelProperty(value = "api描述信息",example = "获取网站的所有用户信息")
    @ApiParam(hidden = false)
    private String info;
    @TableLogic
    @TableField(updateStrategy = FieldStrategy.NEVER,insertStrategy =  FieldStrategy.NEVER)
    @ApiModelProperty(value = "逻辑删除标记",example = "n")
    @ApiParam(hidden = false)
    private String deleted;
    @TableField(updateStrategy = FieldStrategy.NEVER,insertStrategy =  FieldStrategy.NEVER)
    @ApiModelProperty(value = "信息最后修改时间",example = "2023-12-03 12:56:02")
    @ApiParam(hidden = false)
    private Date lastupdate;
}
